package main.model;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "model")
@EntityListeners(AuditingEntityListener.class)
public class Model implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(columnDefinition = "smallint unsigned not null")
    private Integer ID;
    @Column(columnDefinition = "varchar(20)")
    private String picPath;
    @Column(columnDefinition = "varchar(20)")
    private String author;
    @Column(columnDefinition = "text")
    private String content;
    @Column(columnDefinition = "varchar(100)")
    private String title;
    @Column(columnDefinition = "varchar(100)")
    private String source;
    @Column(columnDefinition = "datetime")
    private Date time;
    @Column(columnDefinition = "datetime")
    @CreatedDate
    private Date createTime;
/*    @Column(columnDefinition = "varchar(256)")
    private String remark;*/
}
